//package com.example.exchange.client.exchange;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.reactive.function.client.WebClient;
//import org.springframework.web.reactive.function.client.support.WebClientAdapter;
//import org.springframework.web.service.invoker.HttpServiceProxyFactory;
//
//@Configuration
//public class ExchangeClientConfig {
//    @Value("${caiyun.api-version}")
//    private String apiVersion;
//    @Value("${caiyun.host}")
//    private String host;
//
//
//    @Value("${caiyun.token}")
//    private String token;
//
//
//    @Bean
//    public WebClient webClient() {
//        String sbf = host + "/" + apiVersion + "/" + token;
//        return WebClient.builder()
//                .baseUrl(sbf)
//                .build();
//    }
//
//    @Bean
//    public ExchangeClient createClient(WebClient webClient) {
//        HttpServiceProxyFactory httpServiceProxyFactory =
//                HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient))
//                        .build();
//        return httpServiceProxyFactory.createClient(ExchangeClient.class);
//    }
//
//}
